import request from '@/utils/request'

// 获取用户信息 , 歌单，收藏，mv, dj 数量
export const getUserInfo = data => {
  return request({
    method: 'POST',
    url: '/user/subcount',
    data
  })
}

// 获取账号信息
export const getAccountInfo = data => {
  return request({
    method: 'POST',
    url: `/user/account?cookie=${data.cookie}`
  })
}

// 获取用户等级信息
export const getUserLevel = data => {
  return request({
    method: 'POST',
    url: `/user/level?cookie=${data}`
  })
}

// 获取用户歌单
export const getUserSongList = data => {
  return request({
    method: 'GET',
    url: `/user/playlist?uid=${data.uid}&cookie=${data.cookie}&limit=100`
  })
}

// 获取歌单所有歌曲
export const getPlayListAll = data => {
  return request({
    method: 'POST',
    url: `/playlist/track/all?id=${data.id}&timestamp=${data.timestamp}&cookie=${data.cookie}`
  })
}

// 获取最近播放的歌曲
export const getRecentlyPlayedSong = data => {
  return request({
    method: 'POST',
    url: `/record/recent/song?cookie=${data.cookie}`
  })
}

// 获取最近播放的歌单
export const getRecentlyPlayedSongList = data => {
  return request({
    method: 'POST',
    url: `/record/recent/playlist?cookie=${data.cookie}`
  })
}

// 获取最近播放的电台
export const getRecentlyPlayedDj = data => {
  return request({
    method: 'POST',
    url: `/record/recent/dj?cookie=${data.cookie}`
  })
}

// 获取用户电台
export const getProgramList = data => {
  return request({
    method: 'POST',
    url: `/dj/program?cookie=${data.cookie}&rid=${data.id}`
  })
}
